package com.itheima08;

/**
 * @author Xiao
 * @date 2021/7/13
 */
public class ExceptionDemo {
    /**
     * 异常
     */
    public static void main(String[] args) {
        System.out.println("开始：");
        method();
        System.out.println("结束。");
    }
    public static void method() {
        int[] arr = {0, 1, 2};
        System.out.println(arr[3]);
    }
}
/*
开始：
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
	at com.itheima08.ExceptionDemo.method(ExceptionDemo.java:19)
	at com.itheima08.ExceptionDemo.main(ExceptionDemo.java:13)
    ArrayIndexOutOfBoundsException：异常名称
    Index 3 out of bounds for length 3：异常原因
    ExceptionDemo.java:19：异常位置
 */
